package EvernoteThree;

import java.io.*;
import java.util.*;

public class Solution {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int n = Integer.parseInt(line);
        
        if(n > 0){
        	List<Integer> input = new ArrayList<Integer>();
        	long prod = 1;
        	int numZeros = 0;
	        for(int i = 0; i < n; i++)
	        {
	        	String in = br.readLine();
	        	int val = Integer.parseInt(in);
	        	
	        	//Keep tabs on the number of zeros.
	        	if(val==0)
	        	{
	        		numZeros++;
	        		
	        		if(numZeros > 1)
	        		{
	        			break;
	        		}
	        	}
	        	
	        	//Calculate the running product and add to the list.
	        	prod *= val;
	        	input.add(val);
	        }
	        
	        if(numZeros > 1)
    		{
    			printZeros(n);
    		}
	        else
	        {
	        	printList(getProductList(input, prod));
	        }
        }
		
	}
	
	static void printZeros(int n)
	{
		for(int i = 0; i < n; i++)
		{
			System.out.println(0);
		}
	}
	
	static void printList(List<Long> list)
	{
		for(Iterator<Long> iter = list.iterator(); iter.hasNext();)
		{
			long val = iter.next();
			System.out.println(val);
		}
	}
	
	static List<Long> getProductList(List<Integer> list, long product)
	{
		List<Long> prodList = new ArrayList<Long>();
		int size = list.size();
		
		for(int i = 0; i < size; i++)
		{
			int val = list.get(i);
			
			if(val!=0)
			{
				prodList.add(product/val);
			}
			else if(size>1)
			{
				if(i == 0)
				{
					prodList.add(calculateListProduct(list.subList(1, size)));
				}
				else if(i == size-1)
				{
					prodList.add(calculateListProduct(list.subList(0, size-1)));
				}
				else
				{
					prodList.add(calculateListProduct(list.subList(0, i)) * calculateListProduct(list.subList(i+1, size)));
				}
			}
		}
		
		return prodList;
	}
	
	static long calculateListProduct(List<Integer> list)
	{
		long product = 1;
		
		if(list.size()==0)
		{
			return 0;
		}
		
		for(Iterator<Integer> iter = list.iterator(); iter.hasNext();)
		{
			int val = iter.next();
			product *= val;
		}
		
		return product;
	}
}
